The present invention relates to a position detecting apparatus which detects and outputs a compensated revolution position adjusted according to compensation values, stored according to the ranges of a rotation position indicated on the basis of the number of revolutions of a motor for driving a table, and to a compensation value writing method for the revolution detecting apparatus.
To obtain a compensated rotation position adjusted according to the ranges of the rotation position of a revolving shaft in a conventional servo control apparatus which detects the position of a table using a rotation detecting apparatus for detecting the rotation position of a motor which drives the table, compensation values stored beforehand in a compensation value storage section within a numerical control apparatus (hereinafter referred to as the "NC apparatus") were used to calculate the compensated rotation position. It is to be understood that this compensated rotation position indicates an accurate table position.
FIG. 32 is an arrangement diagram of a servo apparatus wherein a conventional revolution detecting apparatus is employed to write to the compensation value storage section in an NC apparatus the compensation values compensated for by the ranges of the rotation position of the revolving shaft for detecting the table position.
FIG. 33 is an arrangement diagram showing the conventional servo apparatus in a state wherein a measuring instrument has been removed after the compensation values had been written to the compensation value storage section of the NC apparatus, i.e., in an ordinary operation state.
FIG. 34 is an arrangement diagram of the revolution detector in FIGS. 32 and 33.
In FIG. 32, the numeral 101 indicates the NC apparatus, 101a designates a control section, 101b denotes an operation section, 101c represents a difference operation circuit, and 101d indicates a compensation value storage section. 101e represents a feedback input section which is made up of input sections 101f and 101g. 102 denotes a servo amplifier and 3 designates a motor, e.g., a servo motor. 4 indicates a ballscrew of a predetermined pitch coupled with the servo motor 3 by a coupling 4a. 5 denotes a table, e.g., a moving table. It is to be understood that the ballscrew 4 is screwed to a leg 5a of the moving table 5. 5b designates a traveling origin of the moving table 5. 610 represents a revolution detector installed to the servo motor 3, and 7 indicates table position e.g., a measuring instrument, which detects the current position of the moving table 5.
The measuring instrument 7 is a precisely divided linear scale. This measuring instrument 7 consists of a scale 7a similar in length to and disposed in parallel with the ballscrew 4, a detection device 7c, a signal processing circuit 7d and other parts. It is to be understood that the scale 7a is provided with graduations 7b so that phases A and B 90.degree. out of phase with each other are output as electrical signals from the signal output circuit 7d with the travel of the moving table 5.
FIG. 33 shows the arrangement identical to that in FIG. 32 with the exception that the measuring instrument 7 has been removed. A dotted arrow indicates an unused instruction or data flow.
In FIG. 34, 610A denotes a revolution detector which is generally referred to as an optical incremental encoder. It is to be noted that a revolving shaft 10 of this incremental encoder 610A is coupled to a revolving shaft 3a of the servo motor 3 via a coupling 9. 11 represents a code disk provided with slits (not shown) to electrically provide A- and B-phase outputs 90.degree. out of phase with each other. A light-emitting device 12 and a plurality of light-receiving devices 13 are disposed opposite to each other. 14 designates a signal processing circuit which processes a rotation position signal detected by the light-receiving devices 13 as required.
It is to be noted that an apparatus similar to said conventional example is disclosed in Japanese Laid-Open Patent Publication No. SHO62-39159.
Operation will now be described. To compensate for the pitch error of the ballscrew 4, a machine operation panel (not shown) is operated to move the moving table 5 in an overall stroke, with the measuring instrument 7 fitted to the moving table 5 as shown in FIG. 32.
First, when the power is switched on, the NC apparatus 101, the servo amplifier 102 and the servo motor 3 are ready to be driven, the light-emitting device 12 of the revolution detector 6 is lit, and further the measuring instrument 7 is ready for measurement.
Next, under an NC command, a drive instruction is given to the servo amplifier 102. When the revolving shaft 3a of the servo motor 3 rotates, the revolving shaft 10 of the revolution detector 6 rotates, and further the code disk 11 rotates to pass/intercept the light of the light-emitting device 12 through the slits of the code disk 11.
The lights received by the light-receiving devices 13 are converted into currents to electrically provide simulative sine-wave, A- and B-phase rotation position signals 90.degree. out of phase with each other. The signal processing circuit 14 converts the A- and B-phase rotation position signals into a rectangular-wave voltage and outputs it as rotation position data. This rotation position data is entered into the input section 101f of the feedback input section 101e.
Since the ballscrew 4 is rotated by the rotation of the servo motor 3 via the coupling 4a to move the moving table 5, the measuring instrument 7 causes the detection device 7c to detect the graduation 7b of the scale 7a, which is converted into A- and B-phase rectangular-wave signals by the signal processing circuit 7d, and the result of this conversion is output as current position data. This current position data is entered into the input section 101g of the feedback input section 101e.
After receiving the rotation position data and the current position data, the feedback input section 101e transmits a request signal to the control section 101a to command the control section 101a to send a sampling instruction to the difference operation circuit 101c.
At the same time, the input section 101f judges the rotation direction of the revolution detector 610 according to the leading direction of phases A and B, differentiates the leading and trailing edges of phases A and B, creates a pulse on the basis of this differential output, and outputs to the difference operation circuit 1c the rotation position data which has been found by multiplying a division amount four times.
Also, the input section 101g judges the moving direction of the measuring instrument 7 according to the leading direction of phases A and B, differentiates the leading and trailing edges of phases A and B, creates a pulse on the basis of this differential output, and outputs to the difference operation circuit 1c the current position data which has been found by multiplying a division amount four times.
In the meantime, it is needless to say that the travel amount of the moving table 5 does not match the travel amount converted from the revolution amount of the servo motor 3 because of the pitch error of the ballscrew 4.
Then, under the sampling instruction from the control section 101a, the difference operation circuit 101c calculates a difference between the rotation position data and current position data entered, and stores the result of this calculation into the compensation value storage section 101d as a ballscrew pitch error compensation value in the current position. It is needless to say that the pitch error compensation value includes the compensation values of a revolving system torsion error and others, in addition to the compensation value of the ballscrew pitch error.
The command position of the NC command is changed sequentially by a predetermined amount. After the operation is complete in the overall travel range of the moving table 5, the measuring instrument 7 is removed from the moving table 5 and an ordinary operation is started.
In FIG. 33, the operation section 101b calculates the travel data of the moving table 5 under the control of the control section 101a on the basis of the ballscrew pitch error compensation values stored in the compensation value storage section 101d and the rotation position data of the revolution detector 6 entered via the input section 101f.
The control section 101a outputs to the servo amplifier 102 the drive instruction based on a difference between the travel data calculated and the NC command and exercises closed-loop control of the servo motor 3 via the servo amplifier 102. It is to be understood that the travel speed of the moving table 5 is found by calculating the variation of the travel data per unit time.
As an upgraded version of the optical incremental encoder 610A, an optical absolute-value encoder has been used. The absolute value encoder has memory stored with angle detection errors for a plurality of rotational angle ranges into which a single revolution has been divided. This encoder can compensate for the within-one-revolution angle detection errors of the encoder itself by discussing of the storage content of the memory, and outputting the result for compensation.
FIG. 35 is an arrangement diagram of a revolution detector 610 which is an optical absolute-value encoder 611.
In this drawing, 11 indicates a code disk provided with predetermined slits (not shown) to provide signals which indicate an absolute-value rotation position within one revolution and a multi-revolution amount, 15 represents a first light-emitting device, 16 designates a second light-emitting device, and 17 denotes a plurality of first light-receiving devices. 18 indicates a plurality of second light-receiving devices, 19 designates a within-one-revolution signal processing circuit, 20 denotes a multi-revolution amount signal processing circuit, and 21 represents a counter circuit. Also, 122 indicates a central processing circuit having a control section 122a and an operation section 122b. 23 denotes compensating ROM storing division angle error compensation values.
It is to be noted that this division angle error compensation value is an error compensation value set for each of the plurality of rotation angle ranges into which one revolution has been divided.
This division angle error compensation value allows the within-one-revolution detection error of the code disk 11 caused by the pitch error of the code disk 11 slits and the deflection or the like of the code disk 11 due to the misalignment of the code disk 11 and the revolving shaft 10 at the time of installation to be compensated for by the rotation angle ranges.
FIG. 36 illustrates a within-one-revolution accumulative division angle error of the absolute value encoder 611.
The operation of the absolute value encoder 611 shown in FIG. 35 will now be described. When the revolving shaft 3a of the servo motor 3 rotates, the revolving shaft 10 rotates, and further the code disk 11 rotates to pass/intercept the lights of the first light-emitting device 15 and the second light-emitting device 16 through the slits of the code disk 11.
The light-receiving devices 17 convert the light they receive into currents and output a current signal which indicates the within-one-revolution absolute-value rotation position. The within-one-revolution signal processing circuit 19 converts this output into a rectangular-wave voltage and outputs the result into the central processing circuit 122.
The light-receiving devices 18 convert the light they receive into currents and output a multi-revolution amount signal which indicates the number of revolutions. The multi-revolution amount signal processing circuit 20 converts this output into a rectangular-wave voltage.
The counter circuit 21 counts the multi-revolution amount signal and outputs the result of counting into the central processing circuit 122.
Subsequently, the operation section 122b calculates an absolute-value rotation position signal under the control of the control section 122a from the output signal (current value data) from the within-one-revolution signal processing circuit 7d entered via the input section 101g and the compensation value of the compensating ROM 23 (division angle error compensation value within one revolution). Then, the operation section 122b converts the rotation position data, which has been found as a result of the calculation and the contents of the counter circuit 21, into a serial signal and outputs the serial signal to the outside every time a request instruction is received from the outside.
When the power of the revolution detector 6 is switched off, the second light-emitting device 16 and the second light-receiving devices 18, the multi-revolution amount signal processing circuit 20 and the counter circuit 21 are battery (not shown) backed-up, whereby when the power is switched on again, the apparatus can be restarted from where its power had been switched off.
It is to be understood that the within-one-revolution division angle error compensation values stored in the compensating ROM 23 were found by a compensation value operator (not shown) at the time of manufacturing the absolute value encoder 611 and were written to the compensating ROM 23 under the control of the control section 122a.
The compensation value operator calculates the maximum and minimum values of the division angle error for each of the "n" division angle ranges into which one revolution of the absolute encoder 611 has been divided (where "n" is a given integer), finds the typical value of the division angle error from said maximum and minimum values, and outputs the typical value as rotation position data.
For example, FIG. 36 shows the typical values of the division angle ranges when one revolution has been divided into eight ranges (n=8). In this drawing, the horizontal axis represents a rotation position within one revolution and the vertical axis represents an accumulative division angle error within one revolution. Typical values .epsilon.1 to .epsilon.8 found as the half values of the maximum values and the minimum values of the accumulative division angle error in the respective division angle ranges are stored in the compensating ROM 23. It is to be understood that the number of divisions "n" is set according to the capacity of the compensating ROM 23.
An operation using the revolution detector 610 in the system of FIGS. 32 and 33, operating as an absolute encoder 611, will now be described with reference to this operation flowcharts shown in FIGS. 37 and 38.
To compensate for the pitch error of the ballscrew 4, a machine operation panel (not shown) is operated to move the moving table 5 in an overall stroke as described below, with the measuring instrument 7 fitted to the moving table 5 (step S101) in FIGS. 32 and 35.
First, when the power is switched on, the NC apparatus 101, the servo amplifier 102 and the servo motor 3 are ready to be driven, the first light-emitting device 15 and the second light-emitting device 16 of the revolution detector 611 are lit, and further the measuring instrument 7 is ready for measurement.
Next, under an NC command (step S102), the control section 101a gives the servo amplifier 102 a drive instruction based on travel data operated on by the operation section 101b (step S103) to drive the servo motor 3 relative to the origin 5b (step S104).
When the servo motor 3 rotates, the revolving shaft 10 of the absolute encoder 611 rotates, and further the code disk 11 rotates to pass/intercept the light from the first light-emitting device 15 and the second light-emitting device 16 through the slits of the code disk 11.
The light-receiving devices 17 convert the light received into currents and output a current signal which indicates the within-one-revolution absolute-value rotation position. The within-one-revolution signal processing circuit 19 converts this output into a rectangular-wave voltage and outputs the result into the central processing circuit 122.
The light-receiving devices 18 convert the light received into currents and output a multi-revolution amount signal which indicates the number of revolutions. The multi-revolution amount signal processing circuit 20 converts this output into a rectangular-wave voltage. The counter circuit 21 counts the multi-revolution amount signal and outputs the result of counting into the central processing circuit 122.
Subsequently, the operation section 122b calculates a within-one-revolution absolute-value rotation position signal under the control of the control section 122a from the output of the within-one-revolution signal processing circuit 19 and the compensation value (division angle error compensation value within one revolution) already stored in the compensating ROM 23 (step S105).
Then, the operation section 122b composes rotation position data from the result of that calculation and the contents of the counter circuit 21, converts the rotation position data into a serial signal, and outputs the serial signal to the feedback input section 101e every time a request instruction is entered from the servo amplifier 102 (step S106).
Next, the control section 101a judges on the basis of the rotation position data from the absolute encoder 611 whether or not the required rotation position has been reached (step S107). If it has been judged that the required rotation position has not been reached, a drive instruction for that difference is given to the servo amplifier 102 (step S108).
The ballscrew 4 is rotated by the rotation of the servo motor 3 via the coupling 4a to move the moving table 5. The measuring instrument 7 then detects the graduation 7b of the scale 7a using the detection device 7c, converts it into A- and B-phase rectangular-wave signals by means of the signal processing circuit 7d, and outputs the result into the feedback input section 101e as current position data (step S109).
Receiving the rotation position data and the current position data, the feedback input section 101e transmits a request signal to the control section 101a to command the control section 101a to send a sampling instruction to the difference operation circuit 101c.
Simultaneously, the input section 101f outputs a rotation position data direction from the absolute encoder 611 to the difference operation circuit 101c, and the input section 101g judges the rotation direction of the measuring instrument 7 according to the leading direction of phases A and B, differentiates the leading and trailing edges of phases A and B, creates a pulse on the basis of this differential output, and outputs to the difference operation circuit 101c the rotation position data which has been found by multiplying a division amount four times.
In the meantime, it is needless to say that the travel amount of the moving table 5 does not match the travel amount converted from the revolution amount of the servo motor 3 because of the pitch error of the ballscrew 4.
Under the sampling instruction from the control section 101a, the difference operation circuit 101c calculates a difference between the rotation position data and current position data entered (step S110), and stores the result of this calculation into the compensation value storage section 101d as a ballscrew pitch error compensation value in the current position (step S111). It is to be noted that the pitch error compensation value includes the compensation values for at least the revolving system's torsion error, in addition to the compensation value of the ballscrew pitch error.
The command position of the NC command is changed sequentially by a predetermined amount. After the operation is complete in the overall stroke of the ballscrew 4 (step S112), the measuring instrument 7 is removed from the moving table 5 to set up the arrangement for an ordinary operation shown in FIG. 33 (step S113).
When an NC command is given to the control section 101a (step S114), the control section 101a grasps the current position on the basis of the rotation position data from the absolute encoder 611 (step S115) and reads the ballscrew pitch error compensation value corresponding to the current position from the compensation value storage section 101d, and the operation section 101b calculates the travel data of the moving table 5 (step S116).
The control section 101a uses this calculated travel data as a drive instruction (step S117) to drive the servo motor 3 via the servo amplifier 102 (step S118).
When the absolute encoder 611 is rotated by the rotation of the servo motor 3, the revolving shaft 10 rotates inside the absolute encoder 611, and further the code disk 11 rotates to pass/intercept the light from the first light-emitting device 15 and the second light-emitting device 16 through the slits of the code disk 11.
The light-receiving devices 17 convert the light received into currents and output a within-one-revolution absolute-value rotation position signal. The within-one-revolution signal processing circuit 19 converts this output into a rectangular-wave voltage and outputs the result to the central processing circuit 122.
The light-receiving devices 18 convert the light received into currents and output a multi-revolution amount signal which indicates the number of revolutions. The multi-revolution amount signal processing circuit converts this output into a rectangular-wave voltage.
The counter circuit 21 counts the multi-revolution amount signal and outputs the result of counting into the central processing circuit 122.
Subsequently, the operation section 122b compensates for the within-one-revolution absolute-value rotation position signal output from the within-one-revolution signal processing circuit 19 under the control of the control section 122a according to the compensation value in the compensating ROM 23 (division angle error compensation value within one revolution) and composes rotation position data from said compensation value and the contents of the counter circuit 21 (step S119), and converts the composed rotation position data into a serial signal and outputs the serial signal to the feedback input section 101e every time a request instruction is entered from the servo amplifier 102 (step S120).
Also, the control section 101a judges on the basis of the rotation position data from the absolute encoder 611 whether or not the required rotation position has been reached (step S121). If it has been judged that the required rotation position has not been reached, a drive instruction for that difference is given to the servo amplifier 102 (step S122).
As described above, the moving table 5 is moved under the closed-loop control fed back to the NC apparatus 101.
It is to be noted that as described above, the input section 101g where the feedback signal from the measuring instrument 7 is entered at the time of compensation value write and the difference operation circuit 101c which calculates the difference between the detection output of the absolute encoder 611 and the measurement output of the measuring instrument 7 are not required for ordinary operation in the conventional NC apparatus 101, but it is difficult to remove the parts other than the measuring instrument 7, whereby the servo control apparatus in ordinary operation was high in cost.